<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>文章详情</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">

    <link rel="stylesheet" href="__HOME__/css/weui.css">
    <link rel="stylesheet" href="__HOME__/css/jquery-weui.css">
    <link rel="stylesheet" href="__HOME__/css/style.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_689900_q7w1lloaqzg2e29.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_587767_pfl2pe9afar.css">

    <script src="__HOME__/js/jquery.min.js"></script>
    <script src="__HOME__/js/vue.js"></script>

    <style>
        .mycenter-top{background: #fff;overflow: hidden;line-height: 60px;padding:20px;}
        .mycenter-top img{border-radius: 50%;float: left;}

        .weui-grids:before {
            border-top: 0px solid #d9d9d9;
        }
        .weui-grid__label {

            /*color: #ffffff;*/
            font-weight: bold;
            font-size: 16px;
            padding: 5px;
        }
        .weui-grid1 {
            width: 45%;
            height: 120px;
            position: relative;
            float: left;
            width: 45%;
            box-sizing: border-box;
            margin: 2%;
            margin-left: 3%;
        }
    </style>
</head>
<body class="back1"  >
<div class="index-top-fix">
    <a onclick="history.back()"   class="iconfont icon-left- left"></a>
    <p class="title">文章详情</p>
</div>

<div style="margin-top: 50px;background: #fff;">
    <h1  style="text-align: center;font-size: 30px">{$res.title}</h1>
    <div style="margin: 10px auto;"><span  style="padding-left: 15%;padding-right: 15%">作者：{$res.author}</span> 时间:{$res.create_time} </div>
    <div  style="width: 90%;margin-left: 5%">
        {$res.content}
    </div>

    <div  style="height: 50px;position: fixed;bottom: 0; background: white;right: 0;width: 100%;line-height: 50px;text-align: center">
        <div  style="width: 50%;float: left;background: #20c5fc;color:#fff;"><i class="icon icon-yuedu"></i> 阅读量 {$res.hit}</div>
       {if $status == 1}
        <div   style="width: 50%;float: right;background: #ffffff;"><i class="icon icon-zan"  style="color:#20c5fc "></i> {$res.praise}</div>
        {else}
        <div id="a" onclick="zan(this)" style="width: 50%;float: right;background: #ffffff;"><i class="icon icon-zan" id="icon_zan"></i> {$res.praise}</div>
        {/if}
    </div>
</div>
</body>

<script>
    function zan(e) {
    var id ='{$res.id}';
    var praise ='{$res.praise}';
        $.post( "{:url('detail')}",{id:id,praise:praise},function (res) {
            if(res.code == 1){

                $('#icon_zan').css('color', '#20c5fc');
                $("#a").attr("onclick", "");
//                location.replace(location.href);
            }

        })

    }
</script>

</html>

